﻿using System;
using WeiboFilter.DAL;

namespace WeiboFilter
{
    public partial class DataAnalysis : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["oauth_token"] == null && Session["customer"] == null)
            {
                Response.Write("<script>alert('请先登录！');window.location.href='Login.aspx';</script>");
            }
            else
            {
                if (!IsPostBack)
                {
                    bindData();
                }
            }
        }

        private void bindData()
        {
            WordsDAL wD = new WordsDAL(Session["customer"].ToString());
            repKeyWords.DataSource = wD.GetTopWordInfo(10, -10);
            repKeyWords.DataBind();
            Repeater1.DataSource = wD.GetTopWordInfo(10, 10);
            Repeater1.DataBind();
        }
    }
}